﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="addChangeover.aspx.cs"
    Inherits="WorkOrder.addChangeover" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>录入割接单_工单管理支持系统</title>
    <link href="../css/left.css" type="text/css" rel="STYLESHEET" />
    <link href="../css/site2.css" type="text/css" rel="STYLESHEET" />
    <link rel="Shortcut Icon" href="../favicon.ico" type="image/x-icon" />
    <style type="text/css">
        .style1
        {
            height: 24px;
            width: 140px;
        }
        .style2
        {
            width: 120px;
        }
        .style3
        {
        }
    </style>
    <script language="javascript" type="text/javascript">        //加在head中，PNG无灰色背景
        var tmp = window.navigator.userAgent.toLowerCase().indexOf("MSIE");
        //加在head中，PNG无灰色背景
        function correctPNG() {
            for (var i = 0; i < document.images.length; i++) {
                var img = document.images[i];
                var imgName = img.src.toUpperCase();
                if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
                    var imgID = (img.id) ? "id='" + img.id + "' " : "";
                    var imgClass = (img.className) ? "class='" + img.className + "' " : "";
                    var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
                    var imgStyle = "display:inline-block;" + img.style.cssText;
                    if (img.align == "left") imgStyle = "float:left;" + imgStyle;
                    if (img.align == "right") imgStyle = "float:right;" + imgStyle;
                    if (tmp >= 1) {
                        if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
                    }
                    else {
                        if (img.parentNode.href) imgStyle = "cursor:hand;" + imgStyle;
                    }
                    var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
       + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
                    img.outerHTML = strNewHTML;

                }
            }
        }

        if (window.addEventListener) {
            window.addEventListener('DOMContentLoaded', correctPNG, false);   //firefox
            window.addEventListener('load', correctPNG, false);
        } else if (window.attachEvent) {
            window.attachEvent('onload', correctPNG);  //IE
        }

        function LoadTime() {
            var myDate = new Date();
            document.getElementById("txtProStartTime").value = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate() + " " + myDate.getHours() + ":" + myDate.getMinutes() + ":" + myDate.getSeconds();
        }

        function ShowCutProblem() {
            if (document.getElementById("divCutProblems").style.display == "block")
                document.getElementById("divCutProblems").style.display = "none";
            else
                document.getElementById("divCutProblems").style.display = "block";
        }

        var arrZhongqu = new Array(); //2
        arrZhongqu[0] = new Array('大岭山', '6');
        arrZhongqu[1] = new Array('大朗', '7');
        arrZhongqu[2] = new Array('黄江', '8');
        arrZhongqu[3] = new Array('常平', '9');
        arrZhongqu[4] = new Array('东坑', '28');

        var arrChengqu = new Array(); //1
        arrChengqu[0] = new Array('万江', '1');
        arrChengqu[1] = new Array('南城', '2');
        arrChengqu[2] = new Array('东城', '3');
        arrChengqu[3] = new Array('莞城', '4');
        arrChengqu[4] = new Array('松山湖', '5');

        var arrDongqu = new Array(); //3
        arrDongqu[0] = new Array('凤岗', '10');
        arrDongqu[1] = new Array('塘厦', '11');
        arrDongqu[2] = new Array('清溪', '12');
        arrDongqu[3] = new Array('谢岗', '13');
        arrDongqu[4] = new Array('樟木头', '14');
        arrDongqu[5] = new Array('桥头', '31');

        var arrNanqu = new Array(); //4
        arrNanqu[0] = new Array('虎门', '15');
        arrNanqu[1] = new Array('长安', '16');
        arrNanqu[2] = new Array('沙田', '23');

        var arrXiqu = new Array(); //5
        arrXiqu[0] = new Array('中堂', '17');
        arrXiqu[1] = new Array('望牛墩', '18');
        arrXiqu[2] = new Array('麻涌', '19');
        arrXiqu[3] = new Array('高埗', '20');
        arrXiqu[4] = new Array('道滘', '21');
        arrXiqu[5] = new Array('洪梅', '22');
        arrXiqu[6] = new Array('厚街', '24');

        var arrBeiqu = new Array(); //6
        arrBeiqu[0] = new Array('石碣', '25');
        arrBeiqu[1] = new Array('石龙', '26');
        arrBeiqu[2] = new Array('石排', '27');
        arrBeiqu[3] = new Array('寮步', '29');
        arrBeiqu[4] = new Array('横沥', '30');
        arrBeiqu[5] = new Array('茶山', '32');
        arrBeiqu[6] = new Array('企石', '33');

        function resetSelectByArray(sValue) {
            var selectValue = sValue;
            var Obj = document.getElementById("seleTown");
            var arrLen = 0;
            var i = 0;
            var optText;
            var optValue;
            if (selectValue == "1") {
                arrLen = arrChengqu.length;
                Obj.options.length = 0;
                Obj.options.add(new Option('-- 请选择 --', '0'));
                for (i = 0; i < arrLen; i++) {
                    optText = arrChengqu[i][0];
                    optValue = arrChengqu[i][1];
                    Obj.options.add(new Option(optText, optValue));
                }
            }
            else if (selectValue == "2") {
                arrLen = arrZhongqu.length; Obj.options.length = 0;
                Obj.options.add(new Option('-- 请选择 --', '0'));
                for (i = 0; i < arrLen; i++) {
                    optText = arrZhongqu[i][0];
                    optValue = arrZhongqu[i][1];
                    Obj.options.add(new Option(optText, optValue));
                }
            }
            else if (selectValue == "3") {
                arrLen = arrDongqu.length; Obj.options.length = 0;
                Obj.options.add(new Option('-- 请选择 --', '0'));
                for (i = 0; i < arrLen; i++) {
                    optText = arrDongqu[i][0];
                    optValue = arrDongqu[i][1];
                    Obj.options.add(new Option(optText, optValue));
                }
            }
            else if (selectValue == "4") {
                arrLen = arrNanqu.length; Obj.options.length = 0;
                Obj.options.add(new Option('-- 请选择 --', '0'));
                for (i = 0; i < arrLen; i++) {
                    optText = arrNanqu[i][0];
                    optValue = arrNanqu[i][1];
                    Obj.options.add(new Option(optText, optValue));
                }
            }
            else if (selectValue == "5") {
                arrLen = arrXiqu.length; Obj.options.length = 0;
                Obj.options.add(new Option('-- 请选择 --', '0'));
                for (i = 0; i < arrLen; i++) {
                    optText = arrXiqu[i][0];
                    optValue = arrXiqu[i][1];
                    Obj.options.add(new Option(optText, optValue));
                }
            }
            else if (selectValue == "6") {
                arrLen = arrBeiqu.length; Obj.options.length = 0;
                Obj.options.add(new Option('-- 请选择 --', '0'));
                for (i = 0; i < arrLen; i++) {
                    optText = arrBeiqu[i][0];
                    optValue = arrBeiqu[i][1];
                    Obj.options.add(new Option(optText, optValue));
                }
            }
            else if (selectValue == "7") {
                Obj.options.length = 0;
                Obj.options.add(new Option('-- 请选择 --', '0'));
                Obj.options.add(new Option('集客', '34'));
            }
            else if (selectValue == "8") {
                Obj.options.length = 0;
                Obj.options.add(new Option('-- 请选择 --', '0'));
                Obj.options.add(new Option('内部客户', '35'));
            }
            else {
                Obj.options.length = 0;
                Obj.options.add(new Option('-- 请选择 --', '0'));
            }
        }
        String.prototype.trim = function () {
            // 用正则表达式将前后空格，用空字符串替代。
            return this.replace(/(^\s*)|(\s*$)/g, "");
        }

        function saveValidate() {
            var orderNoFormat = /^[A-Z][A-Z][A-Z][A-Z]\-[A-Z][A-Z]\-[A-Z][A-Z][A-Z][A-Z]\-2[0-9][0-9][0-9][0-9][0-9][0-9][0-9]\-[0-9][0-9][0-9][0-9][0-9]$/
            if (document.getElementById("txtBusinessOrderNo").value.trim() == "")
            { alert("请输入业务单号！"); return; }
            else if (!orderNoFormat.exec(document.getElementById("txtBusinessOrderNo").value.trim())) {
                alert("您输入的业务单号格式错误！"); return;
            }
            //            if (document.getElementById("txtOrderNo").value.trim() == "")
            //            { alert("请输入割接单号！"); return; }
            if (document.getElementById("txtStation").value.trim() == "")
            { alert("请输入站点名称！"); return; }
            if (document.getElementById("ddlProduct").value == "0")
            { alert("请选择产品类型！"); return; }
            if (document.getElementById("seleArea").value == "0")
            { alert("请选择区域！"); return; }
            if (document.getElementById("seleTown").value == "0" && (document.getElementById("seleArea").value != "7" || document.getElementById("seleArea").value != "8"))
            { alert("请选择镇区！"); return; }
            else { document.getElementById("hidTown").value = document.getElementById("seleTown").value; }
            if (document.getElementById("txtCustomer").value.trim() == "")
            { alert("请输入客户联系人！"); return; }
            if (document.getElementById("txtCustomerTell").value.trim() == "")
            { alert("请输入客户电话！"); return; }
            if (document.getElementById("txtCustomerAdd").value.trim() == "")
            { alert("请输入客户地址！"); return; }
            if (document.getElementById("ddlFactory").value == "0")
            { alert("请选择设备厂家！"); return; }
            if (document.getElementById("ddlSupervision").value == "0")
            { alert("请选择监理单位！"); return; }
            //if (document.getElementById("txtSupervision").value.trim() == "")
            //{ alert("请输入监理人员！"); return; }
            if (document.getElementById("ddlIntegrated").value == "0")
            { alert("请选择集成单位！"); return; }
            //if (document.getElementById("txtIntegrated").value.trim() == "")
            //{ alert("请输入集成人员！"); return; }
            if (document.getElementById("ddlDebuggion").value == "0")
            { alert("请选择软调单位！"); return; }
            if (document.getElementById("txtFirsetCutTime").value.trim() == "")
            { alert("请输入初次进场割接时间！"); return; }
            if (document.getElementById("ddlStatus").value == "0")
            { alert("请选择目前状态！"); return; }
            document.getElementById("hidID").value = "";
            document.getElementById("form1").submit();
        }
    </script>
</head>
<body style="margin: 0 0 0 0; background-color: #fff; border-left: solid 1px #54a6e2;"
    onload="LoadTime();">
    <form id="form1" runat="server">
    <div>
        <table style="width: 100%">
            <tr>
                <td>
                    <div style="border: solid 1px #9fd6ff; background-color: #d4f1f9; border-bottom: none;">
                        <table style="width: 100%; cursor: pointer;">
                            <tr>
                                <td style="height: 20px;">
                                    &nbsp;&nbsp;<img alt="" align="absmiddle" src="../images/181.gif" />&nbsp; <strong>录入割接单</strong>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="divAdd" style="border: solid 1px #9fd6ff; background-color: #f0f8ff; display: block;">
                        <table style="width: 100%">
                            <tr>
                                <td style="height: 10px">
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 10px;">
                                </td>
                                <td>
                                    <table id="tab2" style="width: 730px; border: solid 1px #9fd6ff">
                                        <tr>
                                            <td align="left" class="style1">
                                                业务单号：
                                            </td>
                                            <td align="left" class="style3" colspan="3">
                                                <asp:ScriptManager ID="ScriptManager1" runat="server">
                                                </asp:ScriptManager>
                                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                                    <ContentTemplate>
                                                        <asp:TextBox ID="txtBusinessOrderNo" runat="server" CssClass="TextBox" Width="195px"></asp:TextBox>
                                                        &nbsp;<asp:ImageButton ID="ImageButton1" runat="server" Height="20px" ImageUrl="../images/find.gif"
                                                            OnClick="ImageButton1_Click" Width="20px" />
                                                        &nbsp;<asp:Label ID="Label1" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="style1">
                                                割接单号：
                                            </td>
                                            <td align="left" class="style3">
                                                <input id="txtOrderNo" type="text" runat="server" class="TextBox" style="width: 195px" />
                                            </td>
                                            <td align="left" style="width: 110px">
                                                站点名称：
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtStation" runat="server" CssClass="TextBox" Width="195px"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="style1">
                                                产品类型：
                                            </td>
                                            <td align="left" class="style3">
                                                <asp:DropDownList ID="ddlProduct" runat="server" CssClass="TextBox" Width="200px">
                                                </asp:DropDownList>
                                            </td>
                                            <td align="left">
                                                镇区：
                                            </td>
                                            <td align="left">
                                                <select id="seleArea" runat="server" style="width: 100px;" class="TextBox" onblur="resetSelectByArray(this.value);"
                                                    onchange="resetSelectByArray(this.value);" name="D2">
                                                    <option value="0" selected="selected">-- 请选择 --</option>
                                                    <option value="1">城区</option>
                                                    <option value="2">中区</option>
                                                    <option value="3">东区</option>
                                                    <option value="4">南区</option>
                                                    <option value="5">西区</option>
                                                    <option value="6">北区</option>
                                                    <option value="7">集客</option>
                                                    <option value="8">内部客户</option>
                                                </select><select id="seleTown" runat="server" style="width: 100px;" class="TextBox"
                                                    name="seleTown">
                                                </select>
                                                <input id="hidTown" type="hidden" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="style1">
                                                客户联系人：
                                            </td>
                                            <td align="left" class="style3">
                                                <input id="txtCustomer" type="text" runat="server" class="TextBox" style="width: 195px" />
                                            </td>
                                            <td align="left">
                                                客户电话：
                                            </td>
                                            <td align="left">
                                                <input id="txtCustomerTell" type="text" runat="server" class="TextBox" style="width: 195px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="style1">
                                                客户地址：
                                            </td>
                                            <td align="left" colspan="3">
                                                <input id="txtCustomerAdd" type="text" runat="server" class="TextBox" style="width: 550px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="style1">
                                                设备厂家：
                                            </td>
                                            <td align="left" class="style3">
                                                <asp:DropDownList ID="ddlFactory" runat="server" Width="200px">
                                                </asp:DropDownList>
                                            </td>
                                            <td align="left">
                                                设备型号：
                                            </td>
                                            <td align="left">
                                                <input id="txtModel" type="text" runat="server" class="TextBox" style="width: 195px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="style1">
                                                监理单位：
                                            </td>
                                            <td align="left" class="style3">
                                                <asp:DropDownList ID="ddlSupervision" runat="server" CssClass="TextBox" Width="200px">
                                                </asp:DropDownList>
                                            </td>
                                            <td align="left">
                                                监理人员：
                                            </td>
                                            <td align="left">
                                                <input id="txtSupervision" type="text" runat="server" class="TextBox" style="width: 195px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="style1">
                                                集成单位：
                                            </td>
                                            <td align="left" class="style3">
                                                <asp:DropDownList ID="ddlIntegrated" runat="server" CssClass="TextBox" Width="200px">
                                                </asp:DropDownList>
                                            </td>
                                            <td align="left">
                                                集成人员：
                                            </td>
                                            <td align="left">
                                                <input id="txtIntegrated" type="text" runat="server" class="TextBox" style="width: 195px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="style1">
                                                软调单位：
                                            </td>
                                            <td align="left" class="style3">
                                                <asp:DropDownList ID="ddlDebuggion" runat="server" CssClass="TextBox" Width="200px">
                                                </asp:DropDownList>
                                            </td>
                                            <td align="left">
                                                软调人员：
                                            </td>
                                            <td align="left">
                                                <input id="txtDebuggion" type="text" runat="server" class="TextBox" style="width: 195px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="style1">
                                                初次进场割接时间：
                                            </td>
                                            <td align="left" class="style3">
                                                <asp:TextBox ID="txtFirsetCutTime" runat="server" CssClass="TextBox" Width="195px"></asp:TextBox>
                                            </td>
                                            <td align="left">
                                                目前状态：
                                            </td>
                                            <td align="left">
                                                <asp:DropDownList ID="ddlStatus" runat="server" CssClass="TextBox" Width="200px">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="style1">
                                                最终回访时间：
                                            </td>
                                            <td align="left" class="style3">
                                                <input id="txtReturnVisit" type="text" runat="server" class="TextBox" style="width: 195px" />
                                            </td>
                                            <td align="left">
                                                <img align="absmiddle" src="../images/drop-add.gif" /><a href="#" id="A1" onclick="ShowCutProblem();"><span
                                                    style="border: 1px; border-bottom: solid 1px #008000">割接问题</span></a>
                                            </td>
                                            <td align="left">
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <div id="divCutProblems" style="display: none">
                            <table style="width: 100%">
                                <tr>
                                    <td style="width: 10px">
                                    </td>
                                    <td>
                                        <table style="width: 730px; border: solid 1px #9fd6ff">
                                            <tr>
                                                <td align="left" class="style1">
                                                    割接问题类型：
                                                </td>
                                                <td align="left" style="width: 250px">
                                                    <asp:DropDownList ID="ddlCutProblem" runat="server" CssClass="TextBox" Width="200px">
                                                    </asp:DropDownList>
                                                </td>
                                                <td style="width: 110px">
                                                    产生问题时间：
                                                </td>
                                                <td>
                                                    <input id="txtProStartTime" type="text" runat="server" class="TextBox" style="width: 195px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left" style="vertical-align: top">
                                                    割接问题描述：
                                                </td>
                                                <td align="left" colspan="3">
                                                    <asp:TextBox ID="txtCutDesc" runat="server" CssClass="TextBox" Width="562px" Height="100px"
                                                        TextMode="MultiLine"></asp:TextBox>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <table style="width: 100%">
                            <tr>
                                <td style="width: 10px; height: 2px;">
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                        <table>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    <table style="width: 730px; border: none">
                                        <tr>
                                            <td align="left" class="style2">
                                                &nbsp;
                                            </td>
                                            <td align="left">
                                                <input id="btnSave" type="button" value="&nbsp;保&nbsp;&nbsp;&nbsp;&nbsp;存&nbsp;"
                                                    class="Button" onclick="saveValidate();" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input
                                                        id="Reset1" type="reset" value="&nbsp;重&nbsp;&nbsp;&nbsp;&nbsp;置&nbsp;" class="Button" />
                                            </td>
                                            <td align="left" colspan="2">
                                                <asp:Label ID="lblMsg" runat="server" Font-Size="12px"></asp:Label>
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="style1">
                                                &nbsp;
                                            </td>
                                            <td align="left">
                                                &nbsp;
                                            </td>
                                            <td align="left">
                                            </td>
                                            <td align="left">
                                                &nbsp;
                                            </td>
                                        </tr>
                                    </table>
                                    <input id="hidID" type="hidden" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
